<%-- 
    Document   : addMenuItem
    Created on : 2009-4-11, 11:11:54
    Author     : 47
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
        String parentname = request.getParameter("parentname");
        String parentid = request.getParameter("parentid");
        if (parentname != null && parentid != null) {
            parentname = new String(parentname.getBytes("ISO-8859-1"), "UTF-8");
            parentid = new String(parentid.getBytes("ISO-8859-1"), "UTF-8");
        } else {
            response.sendRedirect("topMenuManager.jsp");
        }
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="/main/head.jspf" %>
        <title>系统/设置主菜单/添加菜单项</title>
        <script language="javascript" charset="UTF-8">
            function addmenuitem(){
                if(checkValue()){
                    document.getElementById("myform").submit();
                }
            }
            function checkValue(){
                var isOK=true;
                var code=0;
                var tmpStr="";
                var msg="";
                tmpStr=document.getElementById("itemname").value;
                if(tmpStr==""){
                    msg+="\n菜单项名称不能为空";
                    isOK=false;
                }
                tmpStr=document.getElementById("itemuri").value;
                if(tmpStr==""){
                    msg+="\nURI不能为空";
                    isOK=false;
                }
                tmpStr=document.getElementById("ordercode").value;
                if(tmpStr==""){
                    msg+="\n排序码不能为空";
                    isOK=false;
                }
                if(!isOK){
                    alert(msg);
                }
                return isOK;
            }
        </script>
    </head>
    <body>
        <%@include file="/main/bodyhead.jspf" %>
        <br>
            <table align="center" border="1" cellpadding="2" cellspacing="0" width="600px">
    <tr><td>
        <table align="center" border="1" cellpadding="0" cellspacing="0" width="800px">
            <form id="myform" action="addMenuItemdo.jsp" method="post">
                <input type="hidden" name="parentid" value="<%=parentid%>">
                <th colspan="2" class="maintitle">添加菜单项</th>
                <tr>
                    <td class="labelcell">所属菜单组:</td>
                    <td class="inputcell"><%=parentname%></td>
                </tr>
                <tr>
                    <td class="labelcell">菜单项名称:</td>
                    <td class="inputcell" style="width:550px;"><input type="text" id="itemname" name="itemname" style="width:550px;"></td>
                </tr>
                <tr>
                    <td class="labelcell">URI:</td>
                    <td class="inputcell"><input type="text" id="itemuri" name="itemuri" style="width:550px;"></td>
                </tr>
                <tr>
                    <td class="labelcell">排序码:</td>
                    <td class="inputcell"><input type="text" id="ordercode" name="ordercode" style="width:550px;"></td>
                </tr>
                <tr class="controlline">
                    <td colspan="2">
                        <input type="button" value="确定" onclick="addmenuitem()">
                        <input type="button" value="取消" onclick="window.location='topMenuManager.jsp'">
                    </td>
                </tr>
            </form>
        </table>

        </td></tr>
</table>
    </body>
</html>
